#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int getsum(int x)
{
	if (x > 9)
	{
		return getsum(x / 10) + x % 10;
	}
	else
	{
		return x;
	}
}
int main()
{
	int i = 0;
	scanf("%d", &i);
	int ret = getsum(i);
	printf("%d", ret);

	return 0;
}